The updatesPermission is currently initialized synchronously, which
blocks the Mainloop for quite some time and therefore slows down startup
of the shell, let's do it asynchronously instead.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/689
}
// It only makes sense to check for this permission if PackageKit is available.
- try {
- this._updatesPermission = Polkit.Permission.new_sync(
- 'org.freedesktop.packagekit.trigger-offline-update', null, null);
- } catch (e) {
- log('No permission to trigger offline updates: %s'.format(e.toString()));
- }
+ Polkit.Permission.new(
+ 'org.freedesktop.packagekit.trigger-offline-update', null, null,
+ (source, res) => {
+ try {
+ this._updatesPermission = Polkit.Permission.new_finish(res);
+ } catch (e) {
+ log(`No permission to trigger offline updates: ${e}`);
+ }
+ });
}
_onDestroy() {